#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
//int main()
//{
//	int arr1[5] = { 1,2,3,4,5 };
//	int arr2[5] = { 6,7,8,9,0 };
//	int size = sizeof(arr1) / sizeof(arr1[0]);
//	for (int i = 0; i < size; i++)
//	{
//		int tmp = arr1[i];
//		arr1[i] = arr2[i];
//		arr2[i] = tmp;
//	}
//	for (int i = 0; i < size; i++)
//		printf("%d ", arr1[i]);
//	return 0;
//}

void init(int* parr, int sz)
{
	for (int i = 0; i < sz; i++)
		parr[i] = 0;
}

void print(int* parr, int sz)
{
	for (int i = 0; i < sz; i++)
		printf("%d ", parr[i]);
	printf("\n");
}

void reverse(int* parr, int sz)
{
	int left = 0;
	int right = sz - 1;
	while (left < right)
	{
		int tmp = parr[left];
		parr[left] = parr[right];
		parr[right] = tmp;
		left++;
		right--;
	}
}

void BubbleSort(int* parr, int sz)
{
	for (int i = 0; i < sz - 1; i++)
	{
		for (int j = 0; j < sz - 1 - i; j++)
		{
			if (parr[j] > parr[j + 1])
			{
				int tmp = parr[j];
				parr[j] = parr[j + 1];
				parr[j + 1] = tmp;
			}
		}
	}
}

int main()
{
	int arr[10] = { 0,1,2,3,4,5,6,7,8,9 };
	int sz = sizeof(arr) / sizeof(arr[0]);
	reverse(arr, sz);
	print(arr, sz);
	BubbleSort(arr, sz);
	print(arr, sz);
	return 0;
}